namespace PickGold.Charting
{
    using System;
    using System.Collections.Generic;
    using System.Drawing;
    using System.Security.Permissions;
    using System.Web;

    [SRDescription("DescriptionAttributeCustomLabelsCollection_CustomLabelsCollection"), AspNetHostingPermission(SecurityAction.LinkDemand, Level=AspNetHostingPermissionLevel.Minimal), AspNetHostingPermission(SecurityAction.InheritanceDemand, Level=AspNetHostingPermissionLevel.Minimal)]
    public class LegendItemsCollection : ChartElementCollection<LegendItem>
    {
        internal LegendItemsCollection(Legend legend) : base(legend)
        {
        }

        public int Add(Color color, string text)
        {
            LegendItem item = new LegendItem(text, color, "");
            base.Add(item);
            return (base.Count - 1);
        }

        public int Add(string image, string text)
        {
            LegendItem item = new LegendItem(text, Color.Empty, image);
            base.Add(item);
            return (base.Count - 1);
        }

        public void Insert(int index, Color color, string text)
        {
            LegendItem item = new LegendItem(text, color, "");
            base.Insert(index, item);
        }

        public void Insert(int index, string image, string text)
        {
            LegendItem item = new LegendItem(text, Color.Empty, image);
            base.Insert(index, item);
        }

        public void Reverse()
        {
            (base.Items as List<LegendItem>).Reverse();
            this.Invalidate();
        }
    }
}

